package com.example.demo.config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //设置文件请求路径
        registry.addResourceHandler("api/avatar/**").addResourceLocations("file:" + "E:/代码/ASP.net Web程序设计/web程序设大作业/后端/workspace/userAvatar/");
        registry.addResourceHandler("api/classImg/**").addResourceLocations("file:" + "E:/代码/ASP.net Web程序设计/web程序设大作业/后端/workspace/classImg/");
        registry.addResourceHandler("api/classVideo/**").addResourceLocations("file:" + "E:/代码/ASP.net Web程序设计/web程序设大作业/后端/workspace/classVideo/");
    }
}
